﻿@using LY.Business.ServiceImpl
@using LY.Entity.Entities
@using LY.Interface
@using LY.Entity
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "全局众筹";
    bool IsIDValidate = false;//实名认证状态
    var loginUserInfo = System.Web.HttpContext.Current.Session["CurrentUser"] as LY.Entity.U_Member;
    if (loginUserInfo != null)
    {
        IsIDValidate = loginUserInfo.IsIDValidate;
    }
}


@model List<ProjectEx>

<link href="~/Content/zhongchou/css/index.css" rel="stylesheet" />

<div class="banner">
    <ul>
        <li>
            <div class="inner">
            </div>
        </li>
    </ul>
</div>

<div class="body">
    <div class="de_title">产品众筹</div>
    <div class="de_con">
        <div class="d_li">
            <div class="d_li_top">
                <div>
                    @if (Model.Count > 0)
                    {
                        <div class="top_1">
                            <div class="con">
                                <div style="width: 294px; height: 345px; background: url(@Model[0].ProjectThumImage1) center center; background-size: 100% 100%;">
                                </div>
                            </div>
                        </div>
                        <div class="top_2">
                            <div class="con">
                                <div class="t_01">
                                    <div class="title">@Model[0].ProjectName</div>
                                    <div class="descrption">@Model[0].ProjectAdWord</div>
                                </div>
                                <div class="t_02">
                                    <div class="left">
                                        <img src="~/Content/zhongchou/images/alpha_09.png" />
                                    </div>
                                    <div class="right">
                                        <div class="l">
                                            <div class="bc_progress">
                                                @{
                        var StrProjectPercent0 = Model[0].StrProjectPercent;
                        var pp0 = Convert.ToDecimal(StrProjectPercent0.Substring(0, StrProjectPercent0.Length - 1));
                                                }
                                                @if (pp0 >= 100)
                                                {
                                                    <div class="progress" style="width: 100%"></div>
                                                }
                                                else
                                                {
                                                    <div class="progress"  style="width: @Model[0].StrProjectPercent" >&nbsp;</div>
                                                }
                                            </div>
                                        </div>
                                    </div>
                                </div>
                               @if (@Model[0].ProjectStatus != 8)
                        {
                            <div class="t_01">
                                <div class="t_01_li">
                                    <div>已达</div>
                                    <div>@Model[0].StrProjectPercent</div>
                                </div>
                                <div class="t_02_li">
                                    <div>已筹</div>
                                    <div>@Model[0].StrCurrentAmount</div>
                                </div>
                                <div class="t_03_li">
                                    <div>剩余时间</div>
                                    <div>@Model[0].StrRemainDays</div>
                                </div>
                            </div>
                        }
                        else
                        {
                             <div class="t_01">
                                <div class="title">项目预热中</div>
                            </div>
                        } 
                            </div>
                        </div>
                        <a href="/Default/Detail/@Model[0].Id" style="width: 596px; height: 345px; opacity: 0; display: block;" target="_blank"></a>
                    }
                </div>
            </div>
            <div class="d_li_top">
                @if (Model.Count > 1)
                {
                    <div class="top_1 mtop8">

                        <div class="top_con">
                            <div class="t_01">
                                <div class="title">@Model[1].ProjectName</div>
                                <div class="descrption">@Model[1].ProjectAdWord</div>
                            </div>
                            <div class="t_02">
                                <div class="right">
                                    <div class="l">
                                        <div class="bc_progress">
                                            @{
                    var StrProjectPercent = Model[1].StrProjectPercent;
                    var pp = Convert.ToDecimal(StrProjectPercent.Substring(0, StrProjectPercent.Length - 1));
                                            }
                                            @if (pp >= 100)
                                            {
                                                <div class="progress" style="width: 100%"></div>
                                            }
                                            else
                                            {
                                                <div class="progress"  style="width: @Model[1].StrProjectPercent" >&nbsp;</div>
                                            }
                                        </div>
                                    </div>
                                </div>
                                <div class="left">
                                    <img src="~/Content/zhongchou/images/alpha_10.png" />
                                </div>
                            </div>
                          @if (@Model[1].ProjectStatus != 8)
                        {
                            <div class="t_01">
                                <div class="t_01_li">
                                    <div>已达</div>
                                    <div>@Model[1].StrProjectPercent</div>
                                </div>
                                <div class="t_02_li">
                                    <div>已筹</div>
                                    <div>@Model[1].StrCurrentAmount</div>
                                </div>
                                <div class="t_03_li">
                                    <div>剩余时间</div>
                                    <div>@Model[1].StrRemainDays</div>
                                </div>
                            </div>
                        }
                        else
                        {
                             <div class="t_01">
                                <div class="title">项目预热中</div>
                            </div>
                        } 
                        </div>

                    </div>
                    <div class="top_2 mtop8">
                        <div class="top_2_1">
                            <div style="width: 294px; height: 345px; background: url(@Model[1].ProjectThumImage1) center center; background-size: 100% 100%;">
                            </div>
                        </div>
                    </div>
                    <a href="/Default/Detail/@Model[1].Id" style="width: 596px; height: 345px; opacity: 0; display: block; margin-top: 8px; position: absolute;" target="_blank"></a>
                }
            </div>
        </div>
        <div class="d_li">
            @if (Model.Count > 2)
            {
                <div class="padleft4">
                    <div class="d_li_c"  itemid="@Model[2].Id" style="background-image: url(@Model[2].ProjectThumImage1);">
                        <div class="d_li_con">
                            <!--245-->
                            <div class="d_li_c1">
                                <div class="d_li_c1_con"></div>
                            </div>
                            <div class="d_li_cc">
                                <div class="d_li_c2">
                                    @Model[2].ProjectName
                                </div>
                                <div class="d_li_c3">
                                    @{
                if (Model[2].ProjectAdWord.Length > 10)
                {
                                        <span>@Model[2].ProjectAdWord.Substring(0, 10)…</span>
                }
                else
                {
                                        <span>@Model[2].ProjectAdWord</span>
                }
                                    }
                                </div>
                            </div>
                            <div class="d_li_c4" style="margin: 0px auto; width: 400px; height: 232px; position: absolute; padding-top: 466px; padding-left: 96px;">
                                <div style="border-left: 2px solid #fff; border-bottom: 2px solid #fff; border-right: 2px solid #fff; width: 400px; height: 50px; bottom: 0px; position: absolute;"></div>
                            </div>
                        </div>
                        @*  <a href="/Default/Detail/@Model[2].Id" style="background-color:#000;width: 596px;height: 698px;opacity: 0.6;display: block;z-index:200;"  target="_blank"></a>*@
                        <a style="background-color: #000; width: 596px; height: 698px; opacity: 0.6; display: block; z-index: 900;"></a>
                    </div>
                </div>
            }
        </div>
        <div class="d_li">
            @if (Model.Count > 3)
            {
                <div class="padright4">
                    <div class="d_li_c" itemid="@Model[3].Id" style="background-image: url(@Model[3].ProjectThumImage1);">

                        <div class="d_li_con">
                            <!--245-->
                            <div class="d_li_c1">
                                <div class="d_li_c1_con"></div>
                            </div>
                            <div class="d_li_cc">
                                <div class="d_li_c2">
                                    @{
                if (Model[3].ProjectName.Length > 7)
                {
                                        <span>@Model[3].ProjectName.Substring(0, 7)</span>
                }
                else
                {
                                        <span>@Model[3].ProjectName</span>
                }
                                    }
                                </div>
                                <div class="d_li_c3">
                                    @{
                if (Model[3].ProjectAdWord.Length > 10)
                {
                                        <span>@Model[3].ProjectAdWord.Substring(0, 10)…</span>
                }

                else
                {
                                        <span>@Model[3].ProjectAdWord</span>
                }
                                    }
                                </div>
                            </div>
                            <div class="d_li_c4">
                                <div class="d_li_c4_con"></div>
                            </div>
                        </div>
                        <a style="background-color: #000; width: 596px; height: 698px; opacity: 0.6; display: block; z-index: 900;"></a>
                    </div>
                </div>
            }
        </div>
        <div class="d_li">
            <div class="d_li_top">
                <div>
                    @if (Model.Count > 4)
                    {
                        <div class="top_2">
                            <div class="pad4">
                                <div style="width: 294px; height: 345px; background: url(@Model[4].ProjectThumImage1) center center;background-size: 100% 100%;">
                                </div>
                            </div>
                        </div>
                        <div class="top_1">
                            <div class="top1_con">
                                <div class="t_01">
                                    <div class="title">@Model[4].ProjectName</div>
                                    <div class="descrption">@Model[4].ProjectAdWord</div>
                                </div>
                                <div class="t_02">
                                    <div class="left">
                                        <img src="~/Content/zhongchou/images/alpha_09.png" />
                                    </div>
                                    <div class="right">
                                        <div class="l">
                                            <div class="bc_progress">
                                                @{
                        var StrProjectPercent4 = Model[4].StrProjectPercent;
                        var pp4 = Convert.ToDecimal(StrProjectPercent4.Substring(0, StrProjectPercent4.Length - 1));
                                                }
                                                @if (pp4 >= 100)
                                                {
                                                    <div class="progress" style="width: 100%"></div>
                                                }
                                                else
                                                {
                                                    <div class="progress"  style="width: @Model[4].StrProjectPercent" >&nbsp;</div>
                                                }
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                @if (@Model[4].ProjectStatus != 8)
                        {
                            <div class="t_01">
                                <div class="t_01_li">
                                    <div>已达</div>
                                    <div>@Model[4].StrProjectPercent</div>
                                </div>
                                <div class="t_02_li">
                                    <div>已筹</div>
                                    <div>@Model[4].StrCurrentAmount</div>
                                </div>
                                <div class="t_03_li">
                                    <div>剩余时间</div>
                                    <div>@Model[4].StrRemainDays</div>
                                </div>
                            </div>
                        }
                        else
                        {
                             <div class="t_01">
                                <div class="title">项目预热中</div>
                            </div>
                        } 
                            </div>
                        </div>
                        <a href="/Default/Detail/@Model[4].Id" style="width: 596px; height: 345px; opacity: 0; display: block;position: absolute;margin-left: 4px;" target="_blank"></a>
                    }
                </div>
            </div>
            <div class="d_li_top">
                @if (Model.Count > 5)
                {
                    <div class="top_2 mtop8">
                        <div class="top2_con">
                            <div class="t_01">
                                <div class="title">@Model[5].ProjectName</div>
                                <div class="descrption">@Model[5].ProjectAdWord</div>
                            </div>
                            <div class="t_02">
                                <div class="right">
                                    <div class="l">
                                        <div class="bc_progress">
                                            @{
                                                var StrProjectPercent5 = Model[5].StrProjectPercent;
                                                var pp5 = Convert.ToDecimal(StrProjectPercent5.Substring(0, StrProjectPercent5.Length - 1));
                                            }
                                            @if (pp5 >= 100)
                                            {
                                                <div class="progress" style="width: 100%"></div>
                                            }
                                            else
                                            {
                                                <div class="progress"  style="width: @Model[5].StrProjectPercent" >&nbsp;</div>
                                            }
                                        </div>
                                    </div>
                                </div>
                                <div class="left">
                                    <img src="~/Content/zhongchou/images/alpha_10.png" />
                                </div>
                            </div>
                        @if (@Model[5].ProjectStatus != 8)
                        {
                            <div class="t_01">
                                <div class="t_01_li">
                                    <div>已达</div>
                                    <div>@Model[5].StrProjectPercent</div>
                                </div>
                                <div class="t_02_li">
                                    <div>已筹</div>
                                    <div>@Model[5].StrCurrentAmount</div>
                                </div>
                                <div class="t_03_li">
                                    <div>剩余时间</div>
                                    <div>@Model[5].StrRemainDays</div>
                                </div>
                            </div>
                        }
                        else
                        {
                             <div class="t_01">
                                <div class="title">项目预热中</div>
                            </div>
                        } 
                        </div>
                    </div>
                    <div class="top_1 mtop8">
                        <div class="pad4">
                            <div style="width: 294px; height: 345px; background: url(@Model[5].ProjectThumImage1) center center; background-size: 100% 100%;">
                            </div>
                        </div>
                    </div>
                    <a href="/Default/Detail/@Model[5].Id" style="width: 596px; height: 345px; opacity: 0; display: block;position: absolute;margin-top: 353px;margin-left: 4px;" target="_blank"></a>
                }
            </div> 
        </div>
    </div>
    <div class="clear"></div>
    <div style="text-align: center; font-size: 20px; margin-top: 20px;"><a style="color: #2a2929" href="/Default/List1">查看更多</a></div>
    <div class="clear"></div>
    <div class="de_title" style="margin-top: 15px; margin-bottom: 30px;">热门众筹</div>

    <div class="de_con">
        @foreach (var item in Model)
        {
            if (Model.IndexOf(item) < 4)
            {

            <div class="dd_li" style="background: url(@item.ProjectThumImage2) center center;">
                <div class="dd_top">
                    <div class="title">@item.ProjectName</div>
                    <div class="dd_bottom">
                        <div>
                            <div class="bc_progress_re">
                                @{
                var hotProjectPercent = item.StrProjectPercent;
                var hotpp = Convert.ToDecimal(hotProjectPercent.Substring(0, hotProjectPercent.Length - 1));
                                }
                                @if (hotpp >= 100)
                                {
                                    <div class="progress" style="width: 100%"></div>
                                }
                                else
                                {
                                    <div class="progress"  style="width: @item.StrProjectPercent" >&nbsp;</div>
                                }
                            </div>
                        </div>



                        @if (item.CompanyName != "" && item.CompanyName != null)
                        {
                            if (item.CompanyName.Length > 6)
                            {
                                item.CompanyName = LY.Common.Utils.Tools.MyChar('*', 4, item.CompanyName, 1, 1);
                            }
                            <div class="r">
                                <div class="left">共筹资:@item.Amount 发起人：@item.CompanyName</div>
                            </div>
                        }
                        else
                        {
                            if (item.Nickname.Length > 5)
                            {
                                item.Nickname = LY.Common.Utils.Tools.MyChar('*', 4, item.Nickname, 1, 1);
                            }
                            <div class="r">
                                <div class="left">共筹资:@item.Amount 发起人：@item.Nickname</div>
                            </div>
                        }
                    </div>
                </div>
                <a href="/Default/Detail/@item.Id" style="width: 279px; height: 224px; display: block;border-radius: 10px;opacity: 0;" target="_blank"></a>

            </div>
            }

        }

    </div>
    <div class="clear"></div>
    <div class="de_title" style="margin-top: 120px;">成功众筹</div>
    <div class="de_con">
        <div class="df_li_left">
            <img src="~/Content/zhongchou/images/de_left.png" />
        </div>
        @foreach (var item in Model)
        {
            if (Model.IndexOf(item) > 1 && Model.IndexOf(item) < 4)
            {
            <div class="df_li">
                <div class="df_2" style="background: url(@item.ProjectThumImage) center center;">
                    <div class="df_2_bg">
                    </div>
                    <div class="df_2_over">@item.ProjectName</div>
                </div>
            </div>
            }
        }
        @*<div class="df_li">
            <div class="df_2" style="background-image: url(../../Content/zhongchou/images/de_21.jpg);">
                <div class="df_2_bg">
                </div>
                <div class="df_2_over"><a href="#">住这样的房子都市青年的幸福生活社区</a></div>
            </div>
        </div>*@

        <div class="df_li_right">
            <img src="~/Content/zhongchou/images/de_right.png" />
        </div>
    </div>
</div>


<div class="line10"></div>
<div class="line10"></div>
<div class="line10"></div>
<div class="line10"></div>
<div id="plus" class="plus">我要众筹+</div>
<script type="text/javascript">

    $(document).ready(function () {

        $(".dd_li").hover(function () {

            $(this).children(".dd_top").animate({ height: '+=60px' }, "slow", function () {
                $(this).children(".dd_bottom").fadeIn("nomal");
            });

        }, function () {
            $(this).children(".dd_top").animate({ height: '-=60px' }, "slow", function () {
                $(this).children(".dd_bottom").hide();
            });

        });

        $(".df_2").hover(function () {
            $(this).animate({ "font-size": "26px" }, 200);
        }, function () {
            $(this).animate({ "font-size": "20px" }, 200);
        });

        $(".d_li_c").hover(function () {
            $(this).animate({ "background-color": "#000", "opacity": 0.9 }, 200);
            $(this).children(".d_li_con").children(".d_li_cc").children(".d_li_c2").animate({ "font-size": "35px" }, 200);

            $(this).children(".d_li_con").children(".d_li_c1").show();
            $(this).children(".d_li_con").children(".d_li_c4").show();
            $(this).children(".d_li_con").children(".d_li_c1").animate({ "padding-top": "168px" }, 200);
            $(this).children(".d_li_con").children(".d_li_c4").animate({ "padding-top": "200px" }, 200);


        }, function () {
            $(this).animate({ "background-color": "#fff", "opacity": 1 }, 200);
            $(this).children(".d_li_con").children(".d_li_cc").children(".d_li_c2").animate({ "font-size": "26px" }, 200);


            $(this).children(".d_li_con").children(".d_li_c1").animate({ "padding-top": "0px" }, 200, function () { $(this).hide(); });
            $(this).children(".d_li_con").children(".d_li_c4").animate({ "padding-top": "466px" }, 200, function () { $(this).hide(); });

        });



        $(".dd_li ").eq(3).css("margin-right", "0px");

        $("#plus").click(function () {

            if ('@Session["CurrentUser"]' == "" || '@Session["CurrentUser"]' == null) {
                $.dialog.tips("亲~请先登陆哦！", 1, 'tips.gif', function () {
                    window.location.href = "../Login/Index";
                });
            } else {
                //判断是否已经实名认证
                if ('@IsIDValidate' == "False") {
                    $.dialog.tips("亲~请先开通盛付通哦~", 2, "tips.gif", function () {
                        window.location.href = "../Account/AccountInfo";
                    });
                } else {
                    window.location.href = "../Project/Index";
                }
            }
        });

        $(".d_li_c").click(function () {
            var url = "/Default/Detail/" + $(this).attr("itemid");
            window.open(url);
        });
    })

</script>
